package com.enoram.gwt.ui;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class LoginDialog extends DialogBox{

	private Panel panel = new VerticalPanel();
	
	private TextBox userText = new TextBox();
	private PasswordTextBox passText = new PasswordTextBox();
	
	
	
	public LoginDialog(){
		
		setWidget(panel);
		
		setAnimationEnabled(true);
		setGlassEnabled(true);
		panel.add(userText);
		panel.add(passText);
		
		panel.add(new Button("Login", new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				
				hide(true);
				
			}
		}));
		
		setText("Login");
		
		center();
		
		show();
		
		userText.setFocus(true);
		
	}



	
	public String getUserName(){
		return userText.getText();
	}
	
	public String getPassword(){
		return passText.getText();
	}
	
	
}
